\hypertarget{class_configuration}{
\section{Configuration Class Reference}
\label{class_configuration}\index{Configuration@{Configuration}}
}


static class that deals with reading of xml configuration file and initialisations  




{\ttfamily \#include $<$Configuration.h$>$}

\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{class_configuration_a395d5ed998106587bbdd46c4c08b9a50}{initialiseWindow} (int \&o\_\-frameRate, int \&o\_\-mouseMoveSensitivity, ngl::Real \&o\_\-timestep, bool \&o\_\-fpsTimerEnabled, bool \&o\_\-cacheEnabled, int \&o\_\-cacheSamplingInterval, bool \&o\_\-cacheAutomaticFlushEnabled, int \&o\_\-cacheAutomaticFlushInterval, bool \&o\_\-cacheExportRBDEnabled, bool \&o\_\-cacheExportBoundaryEnabled, std::string \&o\_\-path)
\begin{DoxyCompactList}\small\item\em set global parameters from the config file \end{DoxyCompactList}\item 
static ngl::Camera \hyperlink{class_configuration_a26cf545970f53daa51d87b5633091192}{initialiseCamera} (const float \_\-aspect)
\begin{DoxyCompactList}\small\item\em create and return a camera from config file parameters \end{DoxyCompactList}\item 
static ngl::Light \hyperlink{class_configuration_aec145d955281be6be22a5492f4c03163}{initialiseLight} ()
\begin{DoxyCompactList}\small\item\em create and return a light source from config file parameters \end{DoxyCompactList}\item 
static std::vector$<$ \hyperlink{class_shader_object}{ShaderObject} $\ast$ $>$ $\ast$ \hyperlink{class_configuration_a9375f889be4c1707d9d12ea29f5f2aad}{initialiseShader} ()
\begin{DoxyCompactList}\small\item\em create and return the list of shaders from config file parameters \end{DoxyCompactList}\item 
static void \hyperlink{class_configuration_a6777e892c2f0af38a44a81e35e200aee}{initialiseEnvironment} (bool \&o\_\-obstacleEnabled, ngl::Vector \&o\_\-boundaryPosition, ngl::Vector \&o\_\-boundaryDimension, ngl::Real \&o\_\-boundaryRestitutionCoefficientForFluid, ngl::Real \&o\_\-boundaryRestitutionCoefficientForRBD, bool \&o\_\-boundaryBoundTop, std::vector$<$ \hyperlink{class_particle}{Particle} $>$ \&o\_\-sphereObstacleList, std::vector$<$ \hyperlink{class_capsule}{Capsule} $>$ \&o\_\-capsuleObstacleList, ngl::Real \&o\_\-obstacleRestitutionCoefficient, bool \&o\_\-periodicWallEnabled, ngl::Real \&o\_\-periodicWallMaxAmplitude, ngl::Real \&o\_\-periodicWallSpeed, ngl::Real \&o\_\-periodicWallAngleIncrement, int \&o\_\-capsuleResolution)
\begin{DoxyCompactList}\small\item\em initialise environment \end{DoxyCompactList}\item 
static void \hyperlink{class_configuration_a1cc76c4431d5b63dd6ad3fcb612a503e}{initialiseFluidSolver} (ngl::Real \&o\_\-smoothingLength, std::vector$<$ \hyperlink{class_fluid_particle}{FluidParticle} $>$ \&o\_\-particleList, std::vector$<$ \hyperlink{class_fluid_particle}{FluidParticle} $>$ \&o\_\-hoseParticlePrototypeList, std::vector$<$ \hyperlink{class_fluid_particle}{FluidParticle} $>$ \&o\_\-hoseParticleList, ngl::Vector \&o\_\-centerOfHose, ngl::Vector \&o\_\-velocityOfHose, bool \&o\_\-drawHoseMarker, bool \&o\_\-hoseWaitUntilFirstHitBoundary, bool \&o\_\-hoseWaitUntilFirstHitRBD)
\begin{DoxyCompactList}\small\item\em initialise solver \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static bool \hyperlink{class_configuration_adb5d6bf63fe6093b4682679dfb1b640e}{s\_\-debug} = true
\begin{DoxyCompactList}\small\item\em debug parameter used in all the files to enable debugging and console output \end{DoxyCompactList}\item 
static ngl::Real \hyperlink{class_configuration_a4d458e9b6275f95dfb8303e28960f5b2}{s\_\-accelerationOfFreeFall} = -\/9.28
\begin{DoxyCompactList}\small\item\em acceleration due to gravity(free fall) value \end{DoxyCompactList}\item 
static ngl::Colour \hyperlink{class_configuration_a427c9a53472d148454e0d926408969d5}{s\_\-normalColour}
\begin{DoxyCompactList}\small\item\em particle default colour \end{DoxyCompactList}\item 
static ngl::Colour \hyperlink{class_configuration_afc5943dea109f674d8ae290a47aa09d2}{s\_\-boundaryColour}
\begin{DoxyCompactList}\small\item\em boundary colour \end{DoxyCompactList}\item 
static int \hyperlink{class_configuration_a326689b6623296824473ee5a30fab2a7}{s\_\-nextParticleId} = 0
\begin{DoxyCompactList}\small\item\em global unique id available for creation of next particle in a fluid \end{DoxyCompactList}\item 
static int \hyperlink{class_configuration_a41500993a29d7f37abeb17abcb61dd68}{s\_\-nextObstacleId} = -\/1
\begin{DoxyCompactList}\small\item\em global unique id available for creation of next obstacle \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Member Functions}
\begin{DoxyCompactItemize}
\item 
static std::vector$<$ ngl::Real $>$ \hyperlink{class_configuration_a72f0aed7e3e3671ac1a333c0bfff1c88}{getFloatVectorFromString} (const std::string \_\-str, const int \_\-d)
\begin{DoxyCompactList}\small\item\em utility function to split a string into a vector of floats \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
static std::string \hyperlink{class_configuration_aa3393f7c204d7ca3373d503296a49d28}{s\_\-settingsDoc} = \char`\"{}config/Settings.xml\char`\"{}
\begin{DoxyCompactList}\small\item\em the path of the configuration xml file \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
static class that deals with reading of xml configuration file and initialisations 

Definition at line 27 of file Configuration.h.



\subsection{Member Function Documentation}
\hypertarget{class_configuration_a72f0aed7e3e3671ac1a333c0bfff1c88}{
\index{Configuration@{Configuration}!getFloatVectorFromString@{getFloatVectorFromString}}
\index{getFloatVectorFromString@{getFloatVectorFromString}!Configuration@{Configuration}}
\subsubsection[{getFloatVectorFromString}]{\setlength{\rightskip}{0pt plus 5cm}std::vector$<$ ngl::Real $>$ Configuration::getFloatVectorFromString (
\begin{DoxyParamCaption}
\item[{const std::string}]{\_\-str, }
\item[{const int}]{\_\-d}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static, private\mbox{]}}}}
\label{class_configuration_a72f0aed7e3e3671ac1a333c0bfff1c88}


utility function to split a string into a vector of floats 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-str} & the input string to be split \\
\hline
\mbox{\tt in}  & {\em \_\-d} & the count of split parts to be used as the size of the vector \\
\hline
\end{DoxyParams}


Definition at line 32 of file Configuration.cpp.


\begin{DoxyCode}
{
    //split string into array of strings by ","
    std::vector<std::string> strArray;
    boost::split(strArray, _str, boost::is_any_of(","));

    //loop through strings and convert to float array
    std::vector<ngl::Real> floatArray;
    for (int i = 0; i < _d; i++) floatArray.push_back(boost::lexical_cast<ngl::Re
      al>(strArray[i]));

    //return array of float
    return floatArray;
}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a72f0aed7e3e3671ac1a333c0bfff1c88_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_a26cf545970f53daa51d87b5633091192}{
\index{Configuration@{Configuration}!initialiseCamera@{initialiseCamera}}
\index{initialiseCamera@{initialiseCamera}!Configuration@{Configuration}}
\subsubsection[{initialiseCamera}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Camera Configuration::initialiseCamera (
\begin{DoxyParamCaption}
\item[{const float}]{\_\-aspect}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a26cf545970f53daa51d87b5633091192}


create and return a camera from config file parameters 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-aspect} & the aspect ratio to be used for the camera creation \\
\hline
\end{DoxyParams}


Definition at line 90 of file Configuration.cpp.



References getFloatVectorFromString(), and s\_\-settingsDoc.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    //get camera node
    pugi::xpath_node_set node = doc.select_nodes("/Settings/Camera");

    //get near and far plane values
    float near = node.first().node().attribute("near").as_float();
    float far = node.first().node().attribute("far").as_float();

    //get fov
    int fov = node.first().node().attribute("fov").as_int();

    //get from and to values and convert to float arrays
    std::vector<float> from = getFloatVectorFromString(node.first().node().attrib
      ute("from").value(), 3);
    std::vector<float> to = getFloatVectorFromString(node.first().node().attribut
      e("to").value(), 3);

    //build vectors
    ngl::Vector eye(from[0], from[1], from[2]);
    ngl::Vector look(to[0], to[1], to[2]);
    ngl::Vector up(0, 1, 0);

    //create a camera with the read data
    ngl::Camera cam;
    cam.set(eye, look, up);
    cam.setShape(fov, _aspect, near, far, ngl::PERSPECTIVE);

    return cam;
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a26cf545970f53daa51d87b5633091192_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a26cf545970f53daa51d87b5633091192_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_a6777e892c2f0af38a44a81e35e200aee}{
\index{Configuration@{Configuration}!initialiseEnvironment@{initialiseEnvironment}}
\index{initialiseEnvironment@{initialiseEnvironment}!Configuration@{Configuration}}
\subsubsection[{initialiseEnvironment}]{\setlength{\rightskip}{0pt plus 5cm}void Configuration::initialiseEnvironment (
\begin{DoxyParamCaption}
\item[{bool \&}]{o\_\-obstacleEnabled, }
\item[{ngl::Vector \&}]{o\_\-boundaryPosition, }
\item[{ngl::Vector \&}]{o\_\-boundaryDimension, }
\item[{ngl::Real \&}]{o\_\-boundaryRestitutionCoefficientForFluid, }
\item[{ngl::Real \&}]{o\_\-boundaryRestitutionCoefficientForRBD, }
\item[{bool \&}]{o\_\-boundaryBoundTop, }
\item[{std::vector$<$ {\bf Particle} $>$ \&}]{o\_\-sphereObstacleList, }
\item[{std::vector$<$ {\bf Capsule} $>$ \&}]{o\_\-capsuleObstacleList, }
\item[{ngl::Real \&}]{o\_\-obstacleRestitutionCoefficient, }
\item[{bool \&}]{o\_\-periodicWallEnabled, }
\item[{ngl::Real \&}]{o\_\-periodicWallMaxAmplitude, }
\item[{ngl::Real \&}]{o\_\-periodicWallSpeed, }
\item[{ngl::Real \&}]{o\_\-periodicWallAngleIncrement, }
\item[{int \&}]{o\_\-capsuleResolution}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a6777e892c2f0af38a44a81e35e200aee}


initialise environment 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em o\_\-obstacleEnabled} & flag to toggle rbd \\
\hline
\mbox{\tt out}  & {\em o\_\-boundaryPosition} & boundary position \\
\hline
\mbox{\tt out}  & {\em o\_\-boundaryDimension} & boundary size \\
\hline
\mbox{\tt out}  & {\em o\_\-boundaryRestitutionCoefficientForFluid} & boundary-\/fluid restitution \\
\hline
\mbox{\tt out}  & {\em o\_\-boundaryRestitutionCoefficientForRBD} & boundary-\/rbd restitution \\
\hline
\mbox{\tt out}  & {\em o\_\-boundaryBoundTop} & flag to enable top face bounding \\
\hline
\mbox{\tt out}  & {\em o\_\-sphereObstacleList} & list of sphere rbd \\
\hline
\mbox{\tt out}  & {\em o\_\-capsuleObstacleList} & list of capsule rbd \\
\hline
\mbox{\tt out}  & {\em o\_\-obstacleRestitutionCoefficient} & rbd-\/fluid restitution \\
\hline
\mbox{\tt out}  & {\em o\_\-periodicWallEnabled} & flag to toggle periodic wall \\
\hline
\mbox{\tt out}  & {\em o\_\-periodicWallMaxAmplitude} & maximum amplitude of periodic wall \\
\hline
\mbox{\tt out}  & {\em o\_\-periodicWallSpeed} & speed factor of periodic wall \\
\hline
\mbox{\tt out}  & {\em o\_\-periodicWallAngleIncrement} & angle increment of periodic wall \\
\hline
\mbox{\tt out}  & {\em o\_\-capsuleResolution} & capsule resolution of drawing \\
\hline
\end{DoxyParams}


Definition at line 196 of file Configuration.cpp.



References s\_\-nextObstacleId.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    //temporary variable
    std::vector<ngl::Real> tmp;

    //load global settings here
    pugi::xpath_node_set node = doc.select_nodes("/Settings/Environment");

    //read info about the boundary
    tmp = getFloatVectorFromString(node.first().node().select_single_node("Bounda
      ry").node().attribute("position").value(), 3);
    o_boundaryPosition.set(tmp[0], tmp[1], tmp[2]);

    tmp = getFloatVectorFromString(node.first().node().select_single_node("Bounda
      ry").node().attribute("dimension").value(), 3);
    o_boundaryDimension.set(tmp[0], tmp[1], tmp[2]);

    o_boundaryRestitutionCoefficientForFluid = node.first().node().select_single_
      node("Boundary").node().attribute("restitutionForFluid").as_float();
    o_boundaryRestitutionCoefficientForRBD = node.first().node().select_single_no
      de("Boundary").node().attribute("restitutionForRBD").as_float();

    o_boundaryBoundTop = node.first().node().select_single_node("Boundary").node(
      ).attribute("boundTop").as_bool();

    //read info about periodic wall
    o_periodicWallEnabled = node.first().node().select_single_node("Boundary").no
      de().attribute("periodicWallEnabled").as_bool();

    node = node.first().node().select_single_node("Boundary").node().select_nodes
      ("PeriodicWall");

    o_periodicWallMaxAmplitude = node.first().node().attribute("maxAmplitude").as
      _float();
    o_periodicWallSpeed = node.first().node().attribute("speed").as_float();
    o_periodicWallAngleIncrement = node.first().node().attribute("angleIncrement"
      ).as_float();

    //read info about obstacles
    node = doc.select_nodes("/Settings/Environment/Obstacles");
    o_obstacleEnabled =  node.first().node().attribute("enabled").as_bool();

    o_obstacleRestitutionCoefficient = node.first().node().attribute("restitution
      ").as_float();

    o_capsuleResolution = node.first().node().attribute("capsuleResolution").as_i
      nt();

    //get list of sphere obstacles
    node = node.first().node().select_nodes("Sphere");
    for (pugi::xpath_node_set::const_iterator it = node.begin(); it != node.end()
      ; ++it)
    {
        //get details for an obstacle
        pugi::xpath_node node1 = *it;

        //get parameters active parameter
        tmp = getFloatVectorFromString(node1.node().attribute("position").value()
      , 3);
        ngl::Vector position(tmp[0], tmp[1], tmp[2]);

        tmp = getFloatVectorFromString(node1.node().attribute("velocity").value()
      , 3);
        ngl::Vector velocity(tmp[0], tmp[1], tmp[2]);

        ngl::Real radius = node1.node().attribute("radius").as_float();

        ngl::Real moveable = node1.node().attribute("moveable").as_bool();

        tmp = getFloatVectorFromString(node1.node().attribute("colour").value(), 
      3);
        ngl::Colour colour(tmp[0], tmp[1], tmp[2]);

        //create and add obstacle to list
        o_sphereObstacleList.push_back
                (
                    Particle
                    (
                        Configuration::s_nextObstacleId--,
                        0,
                        position,
                        colour,
                        radius,
                        moveable,
                        velocity
                    )
                );
    }

    //get list of capsule obstacles
    node = doc.select_nodes("/Settings/Environment/Obstacles/Capsule");
    for (pugi::xpath_node_set::const_iterator it = node.begin(); it != node.end()
      ; ++it)
    {
        //get details for an obstacle
        pugi::xpath_node node1 = *it;

        //get parameters active parameter
        tmp = getFloatVectorFromString(node1.node().attribute("position1").value(
      ), 3);
        ngl::Vector position1(tmp[0], tmp[1], tmp[2]);

        tmp = getFloatVectorFromString(node1.node().attribute("position2").value(
      ), 3);
        ngl::Vector position2(tmp[0], tmp[1], tmp[2]);

        ngl::Real incrementAngle = node1.node().attribute("incrementAngle").as_fl
      oat();

        ngl::Real initialAngle = node1.node().attribute("initialAngle").as_float(
      );

        ngl::Real radius = node1.node().attribute("radius").as_float();

        ngl::Real moveable = node1.node().attribute("moveable").as_bool();

        tmp = getFloatVectorFromString(node1.node().attribute("colour").value(), 
      3);
        ngl::Colour colour(tmp[0], tmp[1], tmp[2]);

        //calculate orientation vector
        ngl::Vector orientationVector = position2 - position1;

        //calculate height half
        ngl::Real height = orientationVector.length() / 2.0;

        //normalise orientation vector
        orientationVector.normalize();

        //calculate centre position
        ngl::Vector centrePosition = position1 + (orientationVector * height);

        std::cout << "test Capsules : " << centrePosition << "\n";

        //create and add obstacle to list
        o_capsuleObstacleList.push_back
                (
                    Capsule
                    (
                        Configuration::s_nextObstacleId--,
                        0,
                        centrePosition,
                        colour,
                        radius,
                        height,
                        orientationVector,
                        incrementAngle,
                        initialAngle,
                        moveable
                    )
                );
    }

}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a6777e892c2f0af38a44a81e35e200aee_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_a1cc76c4431d5b63dd6ad3fcb612a503e}{
\index{Configuration@{Configuration}!initialiseFluidSolver@{initialiseFluidSolver}}
\index{initialiseFluidSolver@{initialiseFluidSolver}!Configuration@{Configuration}}
\subsubsection[{initialiseFluidSolver}]{\setlength{\rightskip}{0pt plus 5cm}void Configuration::initialiseFluidSolver (
\begin{DoxyParamCaption}
\item[{ngl::Real \&}]{o\_\-smoothingLength, }
\item[{std::vector$<$ {\bf FluidParticle} $>$ \&}]{o\_\-particleList, }
\item[{std::vector$<$ {\bf FluidParticle} $>$ \&}]{o\_\-hoseParticlePrototypeList, }
\item[{std::vector$<$ {\bf FluidParticle} $>$ \&}]{o\_\-hoseParticleList, }
\item[{ngl::Vector \&}]{o\_\-centerOfHose, }
\item[{ngl::Vector \&}]{o\_\-velocityOfHose, }
\item[{bool \&}]{o\_\-drawHoseMarker, }
\item[{bool \&}]{o\_\-hoseWaitUntilFirstHitBoundary, }
\item[{bool \&}]{o\_\-hoseWaitUntilFirstHitRBD}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a1cc76c4431d5b63dd6ad3fcb612a503e}


initialise solver 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em o\_\-smoothingLength} & smoothing length of neighbour structure \\
\hline
\mbox{\tt out}  & {\em o\_\-particleList} & fluid particle list \\
\hline
\mbox{\tt out}  & {\em o\_\-hoseParticlePrototypeList} & list of sample particles for each fluid \\
\hline
\mbox{\tt out}  & {\em o\_\-hoseParticleList} & hose particles \\
\hline
\mbox{\tt out}  & {\em o\_\-centerOfHose} & centre position of hose \\
\hline
\mbox{\tt out}  & {\em o\_\-velocityOfHose} & velocity of hose \\
\hline
\mbox{\tt out}  & {\em o\_\-drawHoseMarker} & flag to toggle whether to draw hose marker \\
\hline
\mbox{\tt out}  & {\em o\_\-hoseWaitUntilFirstHitBoundary} & flag to toggle whether hose particles hit boundary first to start behaving as fluids \\
\hline
\mbox{\tt out}  & {\em o\_\-hoseWaitUntilFirstHitRBD} & flag to toggle whether hose particles hit RBD first to start behaving as fluids \\
\hline
\end{DoxyParams}


Definition at line 350 of file Configuration.cpp.



References s\_\-nextParticleId.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    //load global settings here
    pugi::xpath_node_set node = doc.select_nodes("/Settings/FluidSolver");

    //read smoothing length
    o_smoothingLength = node.first().node().attribute("smoothingLength").as_float
      ();

    //initially reserve space for maximum growth of particle list
    int initialReservedParticleCount =node.first().node().attribute("initialReser
      vedParticleCount").as_int();
    o_particleList.reserve(initialReservedParticleCount);

    //tmp variable
    std::vector<ngl::Real> tmp;

    //get hose info
    node = doc.select_nodes("/Settings/FluidSolver/Hose");

    tmp = getFloatVectorFromString(node.first().node().attribute("center").value(
      ), 3);
    o_centerOfHose = ngl::Vector(tmp[0], tmp[1], tmp[2]);

    o_hoseWaitUntilFirstHitBoundary = node.first().node().attribute("waitUntilHit
      Boundary").as_bool();
    o_hoseWaitUntilFirstHitRBD = node.first().node().attribute("waitUntilHitRBD")
      .as_bool();

    o_drawHoseMarker = node.first().node().attribute("drawMarker").as_bool();

    std::string hoseMeshName = node.first().node().select_single_node("Obj").node
      ().child_value();
    ngl::Obj hoseMesh(hoseMeshName);

    tmp = getFloatVectorFromString(node.first().node().select_single_node("Obj").
      node().attribute("center").value(), 3);
    ngl::Vector centerOfHoseMesh(tmp[0], tmp[1], tmp[2]);

    tmp = getFloatVectorFromString(node.first().node().select_single_node("Veloci
      ty").node().attribute("value").value(), 3);
    o_velocityOfHose = ngl::Vector(tmp[0], tmp[1], tmp[2]);

    for (int i = 0; i < hoseMesh.getNumVerts(); i++)
    {
        //create particle @ mesh vertices and add to hose particle list
        o_hoseParticleList.push_back
                (
                        FluidParticle
                        (
                                0,
                                0,
                                0,
                                centerOfHoseMesh + hoseMesh.getVertexAtIndex(i)
                        )
                );
    }

    //get a list of fluids
    node = doc.select_nodes("/Settings/FluidSolver/Fluid");
    for (pugi::xpath_node_set::const_iterator it = node.begin(); it != node.end()
      ; ++it)
    {
        //get details for a fluid
        pugi::xpath_node node = *it;

        //get its active parameter
        bool isActive = node.node().attribute("active").as_bool();

        //skip this fluid if not active
        if (isActive)
        {
            //else, active fluid => go on creating and adding particles of fluid 
      to particle list

            //read parameters
            ngl::Real volume = boost::lexical_cast<ngl::Real>(node.node().select_
      single_node("Volume").node().child_value());

            ngl::Real materialDensity = boost::lexical_cast<ngl::Real>(node.node(
      ).select_single_node("MaterialDensity").node().child_value());

            tmp = getFloatVectorFromString(node.node().select_single_node("Colour
      ").node().attribute("value").value(), 3);
            ngl::Colour color(tmp[0], tmp[1], tmp[2]);

            std::string meshName = node.node().select_single_node("Obj").node().c
      hild_value();
            ngl::Obj mesh(meshName);

            tmp = getFloatVectorFromString(node.node().select_single_node("Obj").
      node().attribute("center").value(), 3);
            ngl::Vector centerOfMesh(tmp[0], tmp[1], tmp[2]);

            tmp = getFloatVectorFromString(node.node().select_single_node("Veloci
      ty").node().attribute("value").value(), 3);
            ngl::Vector velocity(tmp[0], tmp[1], tmp[2]);

            ngl::Real viscosityConstant = boost::lexical_cast<ngl::Real>(node.nod
      e().select_single_node("ViscosityConstant").node().child_value());

            ngl::Real gasConstant = boost::lexical_cast<ngl::Real>(node.node().se
      lect_single_node("GasConstant").node().child_value());

            ngl::Real surfaceTensionCoefficient = node.node().select_single_node(
      "SurfaceTension").node().attribute("coefficient").as_float();
            ngl::Real surfaceTensionThreshold = node.node().select_single_node("S
      urfaceTension").node().attribute("threshold").as_float();
            ngl::Real surfaceColorCoefficient = node.node().select_single_node("S
      urfaceTension").node().attribute("color").as_float();

            ngl::Real interfaceTensionCoefficient = node.node().select_single_nod
      e("SurfaceInterface").node().attribute("coefficient").as_float();
            ngl::Real interfaceTensionThreshold = node.node().select_single_node(
      "SurfaceInterface").node().attribute("threshold").as_float();
            ngl::Real interfaceColorCoefficient = node.node().select_single_node(
      "SurfaceInterface").node().attribute("color").as_float();

            ngl::Real radius = boost::lexical_cast<ngl::Real>(node.node().select_
      single_node("Radius").node().child_value());

            std::string name = node.node().attribute("name").value();

            //calculate mass per particle
            int particleCount = mesh.getNumVerts();
            ngl::Real mass = materialDensity * (volume / ((ngl::Real)particleCoun
      t));

            std::cout << "Mesh : " << meshName << "\tparticle count : " << partic
      leCount << "\tunit mass : " << mass << "\n";

            //create fluid particles from obj
            for (int i = 0; i < particleCount; i++)
            {
                //create particle @ mesh vertices and add to particle list
                o_particleList.push_back
                        (
                                FluidParticle
                                (
                                        Configuration::s_nextParticleId++,
                                        mass,
                                        materialDensity,
                                        centerOfMesh + mesh.getVertexAtIndex(i),
                                        velocity,
                                        viscosityConstant,
                                        gasConstant,
                                        surfaceTensionCoefficient,
                                        surfaceTensionThreshold,
                                        surfaceColorCoefficient,
                                        interfaceTensionCoefficient,
                                        interfaceTensionThreshold,
                                        interfaceColorCoefficient,
                                        color,
                                        radius,
                                        name
                                )
                        );
            }
            std::cout << "Fluid : << " << name << "\tListSize : " << o_particleLi
      st.size() << "\n";

            //add a sample of this fluid's particle to hose prototype list
            o_hoseParticlePrototypeList.push_back
                    (
                            FluidParticle
                            (
                                    -1,
                                    mass,
                                    materialDensity,
                                    0,
                                    0,
                                    viscosityConstant,
                                    gasConstant,
                                    surfaceTensionCoefficient,
                                    surfaceTensionThreshold,
                                    surfaceColorCoefficient,
                                    interfaceTensionCoefficient,
                                    interfaceTensionThreshold,
                                    interfaceColorCoefficient,
                                    color,
                                    radius,
                                    name,
                                    o_hoseWaitUntilFirstHitBoundary,
                                    o_hoseWaitUntilFirstHitRBD
                            )
                    );
        }
    }
}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=354pt]{class_configuration_a1cc76c4431d5b63dd6ad3fcb612a503e_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_aec145d955281be6be22a5492f4c03163}{
\index{Configuration@{Configuration}!initialiseLight@{initialiseLight}}
\index{initialiseLight@{initialiseLight}!Configuration@{Configuration}}
\subsubsection[{initialiseLight}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Light Configuration::initialiseLight (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_aec145d955281be6be22a5492f4c03163}


create and return a light source from config file parameters 



Definition at line 123 of file Configuration.cpp.



References getFloatVectorFromString(), and s\_\-settingsDoc.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    //get camera node
    pugi::xpath_node_set node = doc.select_nodes("/Settings/Light");

    //get to values and convert to float array
    std::vector<float> to = getFloatVectorFromString(node.first().node().attribut
      e("to").value(), 3);

    //get color values and convert to float array
    std::vector<float> color = getFloatVectorFromString(node.first().node().attri
      bute("color").value(), 4);

    //build vectors
    ngl::Vector direction(to[0], to[1], to[2]);
    ngl::Colour lightColor(color[0], color[1], color[2], color[3]);

    //create a light with the read data
    ngl::Light light(direction, lightColor, ngl::LIGHTREMOTE);

    return light;
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_aec145d955281be6be22a5492f4c03163_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_aec145d955281be6be22a5492f4c03163_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_a9375f889be4c1707d9d12ea29f5f2aad}{
\index{Configuration@{Configuration}!initialiseShader@{initialiseShader}}
\index{initialiseShader@{initialiseShader}!Configuration@{Configuration}}
\subsubsection[{initialiseShader}]{\setlength{\rightskip}{0pt plus 5cm}std::vector$<$ {\bf ShaderObject} $\ast$ $>$ $\ast$ Configuration::initialiseShader (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a9375f889be4c1707d9d12ea29f5f2aad}


create and return the list of shaders from config file parameters 



Definition at line 148 of file Configuration.cpp.



References s\_\-settingsDoc.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    std::vector<ShaderObject*>* result = new std::vector<ShaderObject*>;

    //get list of normal shaders
    pugi::xpath_node_set node = doc.select_nodes("/Settings/Shaders/Shader");
    for (pugi::xpath_node_set::const_iterator it = node.begin(); it != node.end()
      ; ++it)
    {
        //get details for a shader
        pugi::xpath_node node = *it;

        //save values in array
        std::string name = node.node().attribute("name").value();
        std::string vs = node.node().attribute("vertex").value();
        std::string fs = node.node().attribute("fragment").value();
        bool isSpecial = node.node().attribute("isSpecial").as_bool();

        std::vector<std::string> attribNames;
        std::vector<int> attribValues;

        if (isSpecial)
        {
            //load attributes
            pugi::xpath_node_set attributes = node.node().select_nodes("Attrib");
      
            for (pugi::xpath_node_set::const_iterator it1 = attributes.begin(); i
      t1 != attributes.end(); ++it1)
            {
                pugi::xpath_node innerNode = *it1;

                std::string attribName = innerNode.node().attribute("name").value
      ();
                int value = innerNode.node().attribute("value").as_int();

                attribNames.push_back(attribName);
                attribValues.push_back(value);
            }
        }

        //create a shader and add it to our list
        result->push_back(new ShaderObject(name, vs, fs, attribNames, attribValue
      s, isSpecial));
    }

    return result;
}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a9375f889be4c1707d9d12ea29f5f2aad_icgraph}
\end{center}
\end{figure}


\hypertarget{class_configuration_a395d5ed998106587bbdd46c4c08b9a50}{
\index{Configuration@{Configuration}!initialiseWindow@{initialiseWindow}}
\index{initialiseWindow@{initialiseWindow}!Configuration@{Configuration}}
\subsubsection[{initialiseWindow}]{\setlength{\rightskip}{0pt plus 5cm}void Configuration::initialiseWindow (
\begin{DoxyParamCaption}
\item[{int \&}]{o\_\-frameRate, }
\item[{int \&}]{o\_\-mouseMoveSensitivity, }
\item[{ngl::Real \&}]{o\_\-timestep, }
\item[{bool \&}]{o\_\-fpsTimerEnabled, }
\item[{bool \&}]{o\_\-cacheEnabled, }
\item[{int \&}]{o\_\-cacheSamplingInterval, }
\item[{bool \&}]{o\_\-cacheAutomaticFlushEnabled, }
\item[{int \&}]{o\_\-cacheAutomaticFlushInterval, }
\item[{bool \&}]{o\_\-cacheExportRBDEnabled, }
\item[{bool \&}]{o\_\-cacheExportBoundaryEnabled, }
\item[{std::string \&}]{o\_\-path}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a395d5ed998106587bbdd46c4c08b9a50}


set global parameters from the config file 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em o\_\-frameRate} & the frame rate for the simulation \\
\hline
\mbox{\tt out}  & {\em o\_\-mouseMoveSensitivity} & sensitivity value of the mouse (x,y) movement \\
\hline
\mbox{\tt out}  & {\em o\_\-timestep} & global timestep of simulation \\
\hline
\mbox{\tt out}  & {\em o\_\-fpsTimerEnabled} & global timestep of simulation \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheEnabled} & flag to toggle cache \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheSamplingInterval} & cache sampling interval \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheAutomaticFlushEnabled} & flag to toggle automatic flush \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheAutomaticFlushInterval} & automatic flush interval \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheExportRBDEnabled} & flag to toggle cache of rbd \\
\hline
\mbox{\tt out}  & {\em o\_\-cacheExportBoundaryEnabled} & flag to toggle cache of boundary \\
\hline
\mbox{\tt out}  & {\em o\_\-path} & global timestep of simulation \\
\hline
\end{DoxyParams}


Definition at line 50 of file Configuration.cpp.


\begin{DoxyCode}
{
    //load settings xml file
    pugi::xml_document doc;
    doc.load_file(s_settingsDoc.c_str());

    //load global settings here
    pugi::xpath_node_set node = doc.select_nodes("/Settings/Global");

    o_frameRate = node.first().node().attribute("fpsFrequency").as_int();
    o_mouseMoveSensitivity = node.first().node().attribute("mouseSensitivity").as
      _int();
    o_timestep = node.first().node().attribute("timestep").as_float();
    o_fpsTimerEnabled = node.first().node().attribute("fpsTimerEnabled").as_bool(
      );

    //read cache parameters
    node = doc.select_nodes("/Settings/Cache");

    o_cacheEnabled = node.first().node().attribute("enabled").as_bool();
    o_cacheSamplingInterval = node.first().node().attribute("samplingInterval").a
      s_int();
    o_cacheAutomaticFlushEnabled = node.first().node().attribute("automaticFlush"
      ).as_bool();
    o_cacheAutomaticFlushInterval = node.first().node().attribute("automaticFlush
      Interval").as_int();
    o_cacheExportRBDEnabled = node.first().node().attribute("exportRBD").as_bool(
      );
    o_cacheExportBoundaryEnabled = node.first().node().attribute("exportBoundary"
      ).as_bool();

    o_path = node.first().node().attribute("path").value();

}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_configuration_a395d5ed998106587bbdd46c4c08b9a50_icgraph}
\end{center}
\end{figure}




\subsection{Member Data Documentation}
\hypertarget{class_configuration_a4d458e9b6275f95dfb8303e28960f5b2}{
\index{Configuration@{Configuration}!s\_\-accelerationOfFreeFall@{s\_\-accelerationOfFreeFall}}
\index{s\_\-accelerationOfFreeFall@{s\_\-accelerationOfFreeFall}!Configuration@{Configuration}}
\subsubsection[{s\_\-accelerationOfFreeFall}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Real {\bf Configuration::s\_\-accelerationOfFreeFall} = -\/9.28\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a4d458e9b6275f95dfb8303e28960f5b2}


acceleration due to gravity(free fall) value 



Definition at line 34 of file Configuration.h.

\hypertarget{class_configuration_afc5943dea109f674d8ae290a47aa09d2}{
\index{Configuration@{Configuration}!s\_\-boundaryColour@{s\_\-boundaryColour}}
\index{s\_\-boundaryColour@{s\_\-boundaryColour}!Configuration@{Configuration}}
\subsubsection[{s\_\-boundaryColour}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Colour {\bf Configuration::s\_\-boundaryColour}\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_afc5943dea109f674d8ae290a47aa09d2}


boundary colour 



Definition at line 40 of file Configuration.h.

\hypertarget{class_configuration_adb5d6bf63fe6093b4682679dfb1b640e}{
\index{Configuration@{Configuration}!s\_\-debug@{s\_\-debug}}
\index{s\_\-debug@{s\_\-debug}!Configuration@{Configuration}}
\subsubsection[{s\_\-debug}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf Configuration::s\_\-debug} = true\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_adb5d6bf63fe6093b4682679dfb1b640e}


debug parameter used in all the files to enable debugging and console output 



Definition at line 31 of file Configuration.h.

\hypertarget{class_configuration_a41500993a29d7f37abeb17abcb61dd68}{
\index{Configuration@{Configuration}!s\_\-nextObstacleId@{s\_\-nextObstacleId}}
\index{s\_\-nextObstacleId@{s\_\-nextObstacleId}!Configuration@{Configuration}}
\subsubsection[{s\_\-nextObstacleId}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf Configuration::s\_\-nextObstacleId} = -\/1\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a41500993a29d7f37abeb17abcb61dd68}


global unique id available for creation of next obstacle 



Definition at line 46 of file Configuration.h.

\hypertarget{class_configuration_a326689b6623296824473ee5a30fab2a7}{
\index{Configuration@{Configuration}!s\_\-nextParticleId@{s\_\-nextParticleId}}
\index{s\_\-nextParticleId@{s\_\-nextParticleId}!Configuration@{Configuration}}
\subsubsection[{s\_\-nextParticleId}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf Configuration::s\_\-nextParticleId} = 0\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a326689b6623296824473ee5a30fab2a7}


global unique id available for creation of next particle in a fluid 



Definition at line 43 of file Configuration.h.

\hypertarget{class_configuration_a427c9a53472d148454e0d926408969d5}{
\index{Configuration@{Configuration}!s\_\-normalColour@{s\_\-normalColour}}
\index{s\_\-normalColour@{s\_\-normalColour}!Configuration@{Configuration}}
\subsubsection[{s\_\-normalColour}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Colour {\bf Configuration::s\_\-normalColour}\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_configuration_a427c9a53472d148454e0d926408969d5}


particle default colour 



Definition at line 37 of file Configuration.h.

\hypertarget{class_configuration_aa3393f7c204d7ca3373d503296a49d28}{
\index{Configuration@{Configuration}!s\_\-settingsDoc@{s\_\-settingsDoc}}
\index{s\_\-settingsDoc@{s\_\-settingsDoc}!Configuration@{Configuration}}
\subsubsection[{s\_\-settingsDoc}]{\setlength{\rightskip}{0pt plus 5cm}std::string {\bf Configuration::s\_\-settingsDoc} = \char`\"{}config/Settings.xml\char`\"{}\hspace{0.3cm}{\ttfamily  \mbox{[}static, private\mbox{]}}}}
\label{class_configuration_aa3393f7c204d7ca3373d503296a49d28}


the path of the configuration xml file 



Definition at line 146 of file Configuration.h.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
include/\hyperlink{_configuration_8h}{Configuration.h}\item 
src/\hyperlink{_configuration_8cpp}{Configuration.cpp}\end{DoxyCompactItemize}
